package com.synergy.stockflow.production.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "production_task")
public class ProductionTask {
    /**
     * 任务ID
     */
    @TableId(value = "task_id", type = IdType.ASSIGN_ID)
    private String taskId;

    /**
     * 任务名称
     */
    @TableField(value = "task_name")
    private String taskName;

    /**
     * 工作站ID
     */
    @TableField(value = "workstation_id")
    private String workstationId;

    /**
     * 排产数量
     */
    @TableField(value = "task_quantity")
    private BigDecimal taskQuantity;

    /**
     * 已生产数量
     */
    @TableField(value = "computed_quantity")
    private BigDecimal computedQuantity;

    /**
     * 生产时长
     */
    @TableField(value = "production_time")
    private Integer productionTime;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "start_date")
    private Date startDate;

    /**
     * 结束时间（完成时间）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "end_date")
    private Date endDate;

    /**
     * 实际完成时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "actual_finish_time")
    private Date actualFinishTime;

    /**
     * 状态(0=未开始,1=生产中,2=已完成)
     */
    @TableField(value = "task_status")
    private Integer taskStatus;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @TableField(value = "update_time")
    private Date updateTime;


    public String workstationName;

    private String processId;
}